.class public Les/vc;
.super Ljava/lang/Object;
.source "DynamicThreadPool.java"

# interfaces
.implements Ljava/util/concurrent/Executor;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/vc$a;
    }
.end annotation


# static fields
.field private static j:I


# instance fields
.field private a:I

.field private volatile b:Z

.field private final c:Ljava/util/Queue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Queue<",
            "Ljava/lang/Runnable;",
            ">;"
        }
    .end annotation
.end field

.field private final d:I

.field private final e:I

.field private final f:I

.field private final g:I

.field private final h:[Ljava/lang/Thread;

.field private i:I


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method public constructor <init>(Ljava/util/Queue;IIII)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Queue<",
            "Ljava/lang/Runnable;",
            ">;IIII)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput v0, p0, Les/vc;->a:I

    const/4 v1, 0x1

    .line 3
    iput-boolean v1, p0, Les/vc;->b:Z

    .line 4
    iput-object p1, p0, Les/vc;->c:Ljava/util/Queue;

    .line 5
    iput p2, p0, Les/vc;->d:I

    .line 6
    iput p3, p0, Les/vc;->e:I

    .line 7
    iput p4, p0, Les/vc;->f:I

    .line 8
    iput p5, p0, Les/vc;->g:I

    .line 9
    sget p1, Les/vc;->j:I

    iput p1, p0, Les/vc;->a:I

    add-int/2addr p1, v1

    .line 10
    sput p1, Les/vc;->j:I

    .line 11
    new-array p1, p3, [Ljava/lang/Thread;

    iput-object p1, p0, Les/vc;->h:[Ljava/lang/Thread;

    .line 12
    :goto_0
    iget p1, p0, Les/vc;->d:I

    if-ge v0, p1, :cond_0

    .line 13
    iget-object p1, p0, Les/vc;->h:[Ljava/lang/Thread;

    new-instance p2, Les/vc$a;

    iget p3, p0, Les/vc;->a:I

    iget p4, p0, Les/vc;->g:I

    invoke-direct {p2, p0, p3, v0, p4}, Les/vc$a;-><init>(Les/vc;III)V

    aput-object p2, p1, v0

    .line 14
    iget-object p1, p0, Les/vc;->h:[Ljava/lang/Thread;

    aget-object p1, p1, v0

    invoke-virtual {p1}, Ljava/lang/Thread;->start()V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 15
    :cond_0
    iput p1, p0, Les/vc;->i:I

    return-void
.end method

.method static synthetic a(Les/vc;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Les/vc;->b:Z

    return p0
.end method

.method static synthetic b(Les/vc;)Ljava/util/Queue;
    .locals 0

    .line 1
    iget-object p0, p0, Les/vc;->c:Ljava/util/Queue;

    return-object p0
.end method

.method static synthetic c(Les/vc;)I
    .locals 0

    .line 1
    iget p0, p0, Les/vc;->i:I

    return p0
.end method

.method static synthetic d(Les/vc;)I
    .locals 2

    .line 1
    iget v0, p0, Les/vc;->i:I

    add-int/lit8 v1, v0, -0x1

    iput v1, p0, Les/vc;->i:I

    return v0
.end method

.method static synthetic e(Les/vc;)I
    .locals 0

    .line 1
    iget p0, p0, Les/vc;->d:I

    return p0
.end method

.method static synthetic f(Les/vc;)[Ljava/lang/Thread;
    .locals 0

    .line 1
    iget-object p0, p0, Les/vc;->h:[Ljava/lang/Thread;

    return-object p0
.end method


# virtual methods
.method public execute(Ljava/lang/Runnable;)V
    .locals 7

    if-nez p1, :cond_0

    return-void

    .line 1
    :cond_0
    iget-object v0, p0, Les/vc;->c:Ljava/util/Queue;

    monitor-enter v0

    .line 2
    :try_start_0
    iget v1, p0, Les/vc;->i:I

    iget v2, p0, Les/vc;->e:I

    if-ge v1, v2, :cond_2

    .line 3
    iget v1, p0, Les/vc;->i:I

    if-eqz v1, :cond_1

    iget-object v1, p0, Les/vc;->c:Ljava/util/Queue;

    invoke-interface {v1}, Ljava/util/Queue;->size()I

    move-result v1

    iget v2, p0, Les/vc;->f:I

    if-le v1, v2, :cond_2

    .line 4
    :cond_1
    iget-object v1, p0, Les/vc;->h:[Ljava/lang/Thread;

    iget v2, p0, Les/vc;->i:I

    new-instance v3, Les/vc$a;

    iget v4, p0, Les/vc;->a:I

    iget v5, p0, Les/vc;->i:I

    iget v6, p0, Les/vc;->g:I

    invoke-direct {v3, p0, v4, v5, v6}, Les/vc$a;-><init>(Les/vc;III)V

    aput-object v3, v1, v2

    .line 5
    iget-object v1, p0, Les/vc;->h:[Ljava/lang/Thread;

    iget v2, p0, Les/vc;->i:I

    aget-object v1, v1, v2

    invoke-virtual {v1}, Ljava/lang/Thread;->start()V

    .line 6
    iget v1, p0, Les/vc;->i:I

    add-int/lit8 v1, v1, 0x1

    iput v1, p0, Les/vc;->i:I

    .line 7
    :cond_2
    iget-object v1, p0, Les/vc;->c:Ljava/util/Queue;

    invoke-interface {v1, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z

    .line 8
    iget-object p1, p0, Les/vc;->c:Ljava/util/Queue;

    invoke-virtual {p1}, Ljava/lang/Object;->notify()V

    .line 9
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p1
.end method

.method public shutdown()V
    .locals 2

    const/4 v0, 0x0

    .line 1
    iput-boolean v0, p0, Les/vc;->b:Z

    .line 2
    iget-object v0, p0, Les/vc;->c:Ljava/util/Queue;

    monitor-enter v0

    .line 3
    :try_start_0
    iget-object v1, p0, Les/vc;->c:Ljava/util/Queue;

    invoke-interface {v1}, Ljava/util/Queue;->clear()V

    .line 4
    iget-object v1, p0, Les/vc;->c:Ljava/util/Queue;

    invoke-virtual {v1}, Ljava/lang/Object;->notifyAll()V

    .line 5
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method
